package com.example.demo.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * <p>
 * Dan 实体类
 * </p>
 *
 * @author wms
 * @since 2023-02-XX
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Dan对象", description="")
public class Dan implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "时间")
    @TableField("time")
    private Timestamp time;

    @ApiModelProperty(value = "位置")
    @TableField("location")
    private String location;

    @ApiModelProperty(value = "行为")
    @TableField("behavior")
    private String behavior;

    @ApiModelProperty(value = "图像数据")
    @TableField("image_data")
    private byte[] imageData;

    @ApiModelProperty(value = "状态")
    @TableField("status")
    private String status; // 修改为String类型

    public static boolean isValidStatus(String status) {
        // 假设这里只接受'pending', 'approved', 'rejected'这三个值
        return "pending".equals(status) || "approved".equals(status) || "rejected".equals(status);
    }
}

